home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 4 / Macwelt DVD 4.cdr / Entwickler / Mac-OS / oxygen / samples / docbook / xsl / html / onechunk.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-09  |  2.5 KB  |  56 lines  |  [□□□□/□□□□]

  1. onechunk.xslóπ¢tÚπ¢tÚÅÅL®<?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.                 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
  4.                 version="1.0"
  5.                 exclude-result-prefixes="doc">
  6.  
  7. <!-- This stylesheet works with Saxon and Xalan; for XT use xtchunk.xsl -->
  8. <!-- This stylesheet should also work for any processor that supports   -->
  9. <!-- exslt:document() (see http://www.exslt.org/)                       -->
  10.  
  11. <xsl:import href="chunk.xsl"/>
  12.  
  13. <!-- ==================================================================== -->
  14. <!-- What's a chunk?
  15.  
  16.      The root element (that's it in this version)
  17.                                                                           -->
  18. <!-- ==================================================================== -->
  19.  
  20. <xsl:template name="chunk">
  21.   <xsl:param name="node" select="."/>
  22.  
  23.   <xsl:choose>
  24.     <xsl:when test="not($node/parent::*)">1</xsl:when>
  25.     <xsl:otherwise>0</xsl:otherwise>
  26.   </xsl:choose>
  27. </xsl:template>
  28.  
  29. <!-- ==================================================================== -->
  30.  
  31. <xsl:template match="set|book|part|preface|chapter|appendix
  32.                      |article
  33.                      |reference|refentry
  34.                      |book/glossary|article/glossary
  35.                      |book/bibliography|article/bibliography
  36.                      |sect1|/section|section
  37.                      |setindex|book/index|article/index
  38.                      |colophon" priority="2">
  39.   <xsl:variable name="ischunk">
  40.     <xsl:call-template name="chunk"/>
  41.   </xsl:variable>
  42.  
  43.   <xsl:choose>
  44.     <xsl:when test="$ischunk = 1">
  45.       <xsl:call-template name="process-chunk-element"/>
  46.     </xsl:when>
  47.     <xsl:otherwise>
  48.       <xsl:apply-imports/>
  49.     </xsl:otherwise>
  50.   </xsl:choose>
  51. </xsl:template>
  52.  
  53. <!-- ==================================================================== -->
  54.  
  55. </xsl:stylesheet>
  56. This resource fork intentionally left blank   ˇˇ